package java_thinking.unit_11._11_6;

import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

/**
 * @Description : Iterator迭代器
 * @author: cww
 * @DateTime: 2019-03-17 16:57
 */

public class SimpleIteration {
    public static void main(String[] args) {
        List<String> stringList =  Arrays.asList("a","b","c","c");
        Iterator<String> it = stringList.iterator();
        while (it.hasNext()){
            String s = it.next();
            System.out.println(s);
        }
        for (String s:stringList){
            System.out.println(s);
        }
    }


}
